<template>
    <view class="wrap">
        <view class="list">
            <view class="label">客户姓名</view>
            <view class="value">{{item.customerName|filterNull}}</view>
        </view>
        <view class="list">
            <view class="label">联系电话</view>
            <view class="value">{{item.contactMobile|filterNull}}</view>
        </view>
        <view class="list">
            <view class="label">签约订单数</view>
            <view class="value"
                  v-if="item.signOrderCount">{{item.signOrderCount}}单</view>
            <view class="value"
                  v-else>未签约订单</view>
        </view>
        <view class="list">
            <view class="label">所属业务员</view>
            <view class="value">{{item.businessPersonName|filterNull}}</view>
        </view>
        <view class="footer">
            <view>
                <view class="detail"
                      @click="onclick">详情</view>
            </view>
            <view>
                <view class="detail"
                      @click="$emit('select', item)">选择</view>
                <view class="tip">{{item.customerType|customerType}}</view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    props: {
        item: {
            type: Object,
            required: true,
        }
    },
    data() {
        return {
            linkUrl: '/pagesB/my-custom/custom-detail'
        }
    },
    methods: {
        onclick() {
            uni.navigateTo({
                url: this.linkUrl + `?customerId=${this.item.customerId}`
            })
        },
    }
}
</script>

<style lang="scss" scoped src="@/styles/mmv.scss"></style>